import java.util.Scanner;

public class Main {
    //n，a1，a2,a3求它们两两相乘再相加的和，即
    //注意审题 没有重复
    static int sum = 0;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        Integer n=scanner.nextInt();
        int []arr=new int[n];
        for (int i=0;i<n;i++){
            Integer s=scanner.nextInt();
            arr[i]=s;
        }
        s(arr,0,n);
        System.out.println(sum);
    }
    public static void s(int []arr,int i,int n) {
        if (i == n - 1) {
            return;
        }
        int j = i;
        while (n - 1 - j > 0) {
            sum += arr[i] * arr[j + 1];
            j++;
        }
        s(arr, i + 1, n);
    }

}
